/*
 * Singularity Engine
 * Copyright (C) 2010 Vyacheslav Vorobyov, All rights reserved.
 * See LICENSE for full license information.
 */
package org.singularity.lang.model;

import java.util.HashSet;
import java.util.Set;

/**
 * @author vjache
 *
 */
public class LHS {
	
	private final Set<TuplePattern> _tuples = new HashSet<TuplePattern>(10);
	private final Guard _guard;
	
	public LHS(Guard guard) 
	{_guard = guard;}

	/**
	 * 
	 */
	public LHS() 
	{_guard = null;}

	/**
	 * @return the tuples
	 */
	public Set<TuplePattern> getTuples() {
		return _tuples;
	}

	/**
	 * @return the guard
	 */
	public Guard getGuard() {
		return _guard;
	}

	public void toString(StringBuilder sb, String shift) {
		sb.append(shift).append("LHS").append(StringUtil.NL);
		sb.append(shift+StringUtil.TAB).append("GUARD").append(StringUtil.NL);
		sb.append(shift+StringUtil.TAB+StringUtil.TAB).append(_guard.getBool()).append(StringUtil.NL);
		for(TuplePattern tup:_tuples)
		{
			tup.toString(sb,shift+StringUtil.TAB);
			sb.append(StringUtil.NL);
		}
	}

}
